package inits

import (
	"aftersale/config"
	"aftersale/global/pkg"
	"fmt"
)

func Init() {
	config.ReadConfig()
	pkg.MysqlConn()
	pkg.RabbitMqConn = pkg.NewRabbitMQSimple(config.Conf.RabbitMq.Quire)
	go RabSum()
}

func RabSum() {
	simple := pkg.RabbitMqConn.ConsumeSimple()
	fmt.Println("rabbitmq consume opened")
	for delivery := range simple {
		fmt.Println(delivery.Body)
	}
}
